package cn.com.shopec.erp.system.vo;

import java.util.Date;

import javax.persistence.Column;

import cn.com.shopec.erp.common.utils.UuidGenUtils;

/**
 * 
 * @ClassName UserVo
 * @Description 用户Vo
 * @author chengui
 * @date 2013-5-30 上午11:35:33
 */
public class UserVo {
	
	/** 主键. */
	private String id;
	/** 用户名. */
	private String userName;
	/** 用户真实名. */
	private String realName;
	/** 旧密码. */
	private String oldPwd;
	/** 密码. */
	private String pwd;
	/** 用户性质:1-普通用户，2-超级管理员. */
	private int userNature = 1;
	/** 用户状态:1-正常，2-锁定. */
	private int userStatus = 1;
	/** 用户拥有的角色ID. */
	private String[] ownRoleIds;
	/** 删除标识:0-已删除，1-未删除. */
	private int deleteFlag = 1;
	/** 登录限制次数. */
	private int loginCount = 0;
	/** 用户解锁限制时长. */
	private Date enableTime;
	
	public UserVo() {
		super();
	}
	public UserVo(String id) {
		super();
		this.id = id;
	}
	public UserVo(String id, String userName, String realName, String oldPwd,
			String pwd, int userNature, int userStatus, String[] ownRoleIds,
			int deleteFlag) {
		super();
		this.id = id;
		this.userName = userName;
		this.realName = realName;
		this.oldPwd = oldPwd;
		this.pwd = pwd;
		this.userNature = userNature;
		this.userStatus = userStatus;
		this.ownRoleIds = ownRoleIds;
		this.deleteFlag = deleteFlag;
	}
	
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getUserName() {
		return UuidGenUtils.filterDecode(userName);
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}
	public String getRealName() {
		return UuidGenUtils.filterDecode(realName);
	}
	public void setRealName(String realName) {
		this.realName = realName;
	}
	public String getOldPwd() {
		return oldPwd;
	}
	public void setOldPwd(String oldPwd) {
		this.oldPwd = oldPwd;
	}
	public String getPwd() {
		return pwd;
	}
	public void setPwd(String pwd) {
		this.pwd = pwd;
	}
	public int getUserNature() {
		return userNature;
	}
	public void setUserNature(int userNature) {
		this.userNature = userNature;
	}
	public int getUserStatus() {
		return userStatus;
	}
	public void setUserStatus(int userStatus) {
		this.userStatus = userStatus;
	}
	public String[] getOwnRoleIds() {
		return ownRoleIds;
	}
	public void setOwnRoleIds(String[] ownRoleIds) {
		this.ownRoleIds = ownRoleIds;
	}
	public int getDeleteFlag() {
		return deleteFlag;
	}
	public void setDeleteFlag(int deleteFlag) {
		this.deleteFlag = deleteFlag;
	}
	public int getLoginCount() {
		return loginCount;
	}
	public void setLoginCount(int loginCount) {
		this.loginCount = loginCount;
	}
	public Date getEnableTime() {
		if(enableTime==null){
			enableTime=new Date();
		}
		return enableTime;
	}
	public void setEnableTime(Date enableTime) {
		this.enableTime = enableTime;
	}
	
}
